Skip to main content

Users

Base URL

All following endpoints operates over the URL of your store: https://your-store.com

example: https://alephdigital.publica.la

Endpoints
Create
Retrieve
Update
Deactivate
Reactivate
Force Logout

Headers

{
"Content-Type": "application/json",
"Accept": "application/json",
"X-User-Token": api_token,
}
info

Make sure you generated the api_token on your store. More info HERE

Create

POST /integration-api/v1/dashboard/users/

Body Parameters

ParameterTypeDescription
external_idstringRequired
emailstringRequired
new_passwordstringRecommended
sessions_limitinteger
assign_new_planinteger
new_plan_custom_valid_tostring
adminboolean
plan_adminboolean
only_sees_readableboolean
{
"email":"[email protected]",
"external_id":"user-id-in-your-platform",
"new_password":"Abcd1234",
"sessions_limit":null, //if you need to limit the simultaneous user sessions, here you must enter an integer no greater than 999999
"assign_new_plan": null, //if you need to assign a plan, you must enter the plan_id here
"new_plan_custom_valid_to":"", //Accepted date format: yyyy-mm-dd
"admin":false,
"plan_admin":false,
"only_sees_readable":true,
}

Response

CodeDescription
200Object Created
422Validation error, the reason of the error will be described in the response body
401Unauthenticated

Response example

{
"CODE": "success",
"data": {
"id": 923242,
"email": "[email protected]",
"uuid": "af5af4f9-9b8d-4d79-b162-0cec4279cae5",
"picture": "https://www.gravatar.com/avatar/5c472faa5105266a3d41aee277eb9d0c?s=160&d=mm&r=g",
"admin": false,
"plan_admin": false,
"only_sees_readable": false,
"sessions_limit": null,
"created_at": {
"timestamp": 1620931649,
"date": "2021-05-13 18:47:29",
"timezone": "UTC"
},
"updated_at": {
"timestamp": 1621256387,
"date": "2021-05-17 12:59:47",
"timezone": "UTC"
},
"deleted_at": null
}
}

Retrieve

GET /integration-api/v1/dashboard/users

Example: https://your-store.com/integration-api/v1/dashboard/users

tip

Using query parameter you can filter by email, deactivated and admins users

Example 1: https://your-store.com/integration-api/v1/dashboard/users/[email protected]

Example 2: https://your-store.com/integration-api/v1/dashboard/users/?query=deactivated

Example 3: https://your-store.com/integration-api/v1/dashboard/users/?query=admins

Response

CodeDescription
200Success
404Object not found
401Unauthenticated

Response Example

Example
{
"CODE": "success",
"data": {
"paginator": {
"current_page": 1,
"data": [
{
"id": 923242,
"uuid": "af5af4f9-9b8d-4d79-b162-0cec4279cae5",
"admin": false,
"plan_admin": false,
"email": "[email protected]",
"sessions_limit": 1,
"only_sees_readable": 1,
"picture": "https://www.gravatar.com/avatar/98789c9d5825d6f6c6615313ffcaf1ac?s=160&d=mm&r=g",
"created_at": "2021-05-18T13:28:53.000000Z",
"updated_at": "2021-05-18T13:28:53.000000Z",
"deleted_at": null,
"purchased_issues_with_cancelled_count": 0,
"user_plans_count": 0,
"can_be_edited": true,
"created_at_date_string": "2021-05-18",
"impersonate": "https://unlimitedtestautomation.publicala.me/impersonate/take/53114",
"sessions": null,
"ip_ranges": [],
"referrers": [],
"purchased_issues_with_cancelled": [],
"user_plans": []
},
{
...
}]
}
}
}

Update

PUT /integration-api/v1/dashboard/users/{user_id}

Example: https://your-store.com/integration-api/v1/dashboard/users/923242

Parameters

ParameterTypeDescription
external_idstringRequired
emailstringRequired
new_passwordstringRecommended
sessions_limitinteger
assign_new_planinteger
new_plan_custom_valid_tostring
adminboolean1 or 0
plan_adminboolean1 or 0
only_sees_readablebooleanRequired 1 or 0
user_plan_name

Response

CodeDescription
204Object Updated
422Validation error, the reason of the error will be described in the response body
401Unauthenticated

Deactivate

IMPORTANT NOTE

This endpoint enables you to deactivate an user. A deactivated user can not log in through any means.

DELETE /integration-api/v1/dashboard/users/{id}

Example: https://your-store.com/integration-api/v1/dashboard/users/923242

Response

CodeDescription
200Object deleted
404Object not found
401Unauthenticated

Response example

{
"CODE": "success",
"data": []
}

Reactivate

PUT /integration-api/v1/dashboard/users/{user_id}/re-activate

Example: https://your-store.com/integration-api/v1/dashboard/users/923242/re-activate

Response

CodeDescription
200Object deleted
404Object not found
401Unauthenticated

Response Example

{
"CODE": "success",
"data": 1
}

Force Logout

POST /integration-api/v1/users/{user_id}/force-logout

Example: https://your-store.com/integration-api/v1/dashboard/users/923242/force-logout

After logging out, the user will be redirected to the initial URL on its next interaction with the system.

The endpoint receives as user identifier the ID or the external_id. Keep in mind that in the case the external-auth-token is used then the external_id is the UUID contained in the token.